boolean_param("earlygdb", opt_earlygdb);
u32 tlbflush_clock = 1U;
-u32 tlbflush_time[NR_CPUS];
+DEFINE_PER_CPU(u32, tlbflush_time);
unsigned int watchdog_on;
unsigned long wait_init_idle;
#endif
u32 tlbflush_clock = 1U;
-u32 tlbflush_time[NR_CPUS];
+DEFINE_PER_CPU(u32, tlbflush_time);
void write_cr3(unsigned long cr3)
{
* case, so really we are being ultra paranoid.
*/
- tlbflush_time[smp_processor_id()] = t2;
+ this_cpu(tlbflush_time) = t2;
local_irq_restore(flags);
}
if ( unlikely(cache->epoch != cache->shadow_epoch[vcpu]) )
{
cache->shadow_epoch[vcpu] = cache->epoch;
- if ( NEED_FLUSH(tlbflush_time[smp_processor_id()],
- cache->tlbflush_timestamp) )
+ if ( NEED_FLUSH(this_cpu(tlbflush_time), cache->tlbflush_timestamp) )
{
perfc_incrc(domain_page_tlb_flush);
local_flush_tlb();
#define _ASM_FLUSHTLB_H_
#include <xen/config.h>
+#include <xen/percpu.h>
#include <xen/types.h>
#include <asm/misc.h>
#define tlbflush_current_time() tlbflush_clock
/* Time at which each CPU's TLB was last flushed. */
-extern u32 tlbflush_time[NR_CPUS];
+DECLARE_PER_CPU(u32, tlbflush_time);
static inline int NEED_FLUSH(u32 cpu_stamp, u32 lastuse_stamp)
{
* Filter the given set of CPUs, removing those that definitely flushed their
* TLB since @page_timestamp.
*/
-#define tlbflush_filter(mask, page_timestamp) \
-do { \
- unsigned int cpu; \
- for_each_cpu_mask ( cpu, mask ) \
- if ( !NEED_FLUSH(tlbflush_time[cpu], page_timestamp) ) \
- cpu_clear(cpu, mask); \
+#define tlbflush_filter(mask, page_timestamp) \
+do { \
+ unsigned int cpu; \
+ for_each_cpu_mask ( cpu, mask ) \
+ if ( !NEED_FLUSH(per_cpu(tlbflush_time, cpu), page_timestamp) ) \
+ cpu_clear(cpu, mask); \
} while ( 0 )
#define __X86_CURRENT_H__
#include <xen/config.h>
+#include <xen/percpu.h>
#include <public/xen.h>
#include <asm/page.h>
#define schedule_tail(vcpu) (((vcpu)->arch.schedule_tail)(vcpu))
-#include <xen/percpu.h>
/*
* Which VCPU's state is currently running on each CPU?
* This is not necesasrily the same as 'current' as a CPU may be
#define __FLUSHTLB_H__
#include <xen/config.h>
+#include <xen/percpu.h>
#include <xen/smp.h>
+#include <xen/types.h>
/* The current time as shown by the virtual TLB clock. */
extern u32 tlbflush_clock;
/* Time at which each CPU's TLB was last flushed. */
-extern u32 tlbflush_time[NR_CPUS];
+DECLARE_PER_CPU(u32, tlbflush_time);
#define tlbflush_current_time() tlbflush_clock
* Filter the given set of CPUs, removing those that definitely flushed their
* TLB since @page_timestamp.
*/
-#define tlbflush_filter(mask, page_timestamp) \
-do { \
- unsigned int cpu; \
- for_each_cpu_mask ( cpu, mask ) \
- if ( !NEED_FLUSH(tlbflush_time[cpu], page_timestamp) ) \
- cpu_clear(cpu, mask); \
+#define tlbflush_filter(mask, page_timestamp) \
+do { \
+ unsigned int cpu; \
+ for_each_cpu_mask ( cpu, mask ) \
+ if ( !NEED_FLUSH(per_cpu(tlbflush_time, cpu), page_timestamp) ) \
+ cpu_clear(cpu, mask); \
} while ( 0 )
extern void new_tlbflush_clock_period(void);
#define __XEN_PERCPU_H__
#include <xen/config.h>
-#include <xen/smp.h>
#include <asm/percpu.h>
/* Preferred on Xen. Also see arch-defined per_cpu(). */